<script type="text/javascript">
function submitFrom(){
	var type = $("input[name='publishtype']:checked").val();
	if(type==0){//本地发布
		location.href="/${orgi}/dm/cube/${cubeid!''}/"+$("input[name='isRecover']:checked").val()+"/"+$("input[name='freshetl']:checked").val()+"/localpublish.html";
	}else{//远程发布
		if($("#mainForm").valid()){
			if($("#dbsourcefield").css("display")!="none"){
				$("#mainForm").submit();
			}else{
				loadDBSource();
			}
		}
		
		
	}
}
function loadDBSource(){
	var url = $("#url").val();
	loadURL('/${orgi}/dm/cube/remotedbsourcelist.html?url='+encodeURIComponent(url),'#dbsource_div',null);
}

function checkUrl(){
		var geturl = $("#url").val();
		if (geturl==""){
			alertMsg("请输入服务器地址!");
		} else {
			loadDBSource();
		}
   }
</script>
<div class="artCon">
	<div class="middleArt form-horizontal">
	
<form class="form-horizontal" id="mainForm" action="/${orgi}/dm/cube/${cubeid}/remotepublish.html" data-toggle="form" method="post">
		<div class="artMain">
			<div class="mainCenter"> 
				<fieldset class="control-group">
				<label for="name" class="control-label">发布方式：</label>
					<div class="controls">
					<label class="radio inline" style="width: 100px;"><input checked="checked" onclick="document.getElementById('remote_publish_div').style.display='none'" type="radio" value="0" name="publishtype">本地发布</label>
					<label class="radio inline" style="width: 100px;"><input onclick="document.getElementById('remote_publish_div').style.display='block'" type="radio" value="1" name="publishtype">远程发布</label>
					</div>
				</fieldset>
				
				<fieldset class="control-group">
				<label for="name" class="control-label">更新结算：</label>
					<div class="controls">
					<label class="radio inline" style="width: 100px;"><input type="radio" value="1" name="freshetl">是</label>
					<label class="radio inline" style="width: 100px;"><input checked="checked" type="radio" value="0" name="freshetl">否</label>
					</div>
				</fieldset>
	
				<fieldset class="control-group">
					<label for="name" class="control-label">发布选项：</label>
					<div class="controls">
						<label class="radio inline" style="width: 100px;"><input type="radio" checked="checked" value="yes" name="isRecover">覆盖最新版本</label>
						<label class="radio inline" style="width: 100px;" ><input type="radio" value="no" name="isRecover">创建新版本</label>
						<label class="radio inline" style="width: 100px;" ><input type="radio" value="del" name="isRecover">删除之前版本</label>
					</div>
				</fieldset>

				
				<div id="remote_publish_div" style="display: none;">
					<fieldset class="control-group">
						<label for="name" class="control-label">服务器地址：</label>
						<div class="controls">
							<input type="text" name="url" id="url" maxlength="200"class="span3 required">
							<i class="inputip">*</i>&nbsp;&nbsp;&nbsp;<input type="button" onclick="checkUrl()" class="subButtonStyle" value="加载" />
						</div>
					</fieldset>
					<div id="dbsource_div">
					<#include "/pages/datamodel/cube/remotedbsourcelist.html"/>
					</div>
							
				</div>

				
				
			</div>
		</div>
		<div class="bottomBg">
			<div class="btnWrap">
				<input type="button" onclick="submitFrom()" class="subButtonStyle" value="确认"/>
				<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
			</div>
		</div>
	</form>
	</div>
</div>
